1. Field of the Invention
The present invention relates to an encoder and a decoder for moving picture, and more specifically to a hybrid-type moving picture coding system for performing a motion compensating process and an orthogonal transforming process for each block obtained by dividing an input image into a plurality of blocks.
2. Description of the Related Art
Since the volume of moving picture data is normally large, a coding process is performed to compress the data when it is transmitted from a transmission device to a reception device, or when it is stored in a storage device.
FIG. 1 is a block diagram of a conventional encoder. FIG. 2 is a block diagram of a conventional decoder for decoding moving picture data coded by the encoder shown in FIG. 1. In this example, the hybrid coding system realized by combining a motion compensation inter-frame predicting process and an orthogonal transforming process is explained as follows.
An encoder 500 divides an input image into a plurality of blocks (each block comprises L rows x M columns) for each frame, and performs a coding process on each block. That is, the encoder 500 first generates a predicted image for each block, and computes difference data between the predicted image and an actually input image (target image). Then, it performs an orthogonal transforming process, a quantizing process, and an entropy coding process on the difference data, and outputs resultant data. At this time, a prediction parameter (a motion vector in this example) is also output.
An orthogonal transform unit 501 orthogonally transforms given data. An orthogonal transforming process can be, for example, DCT (discrete cosine transform). A quantization unit 502 quantizes an output of the orthogonal transform unit 501. An inverse quantization unit 503, an inverse orthogonal transform unit 504, and a decoded image generation unit 505 are provided to generate an image which is the same as that to be regenerated by a decoder 600 shown in FIG. 2. The image generated through these units is stored in a decoded image storage unit 506.
A prediction parameter computation unit 507 computes a parameter (a motion vector in this example) for prediction of an image based on the image stored in the decoded image storage unit 506 and a newly input image, and determines whether an inter-frame coding process is to be performed, or an intra-frame coding process is to be performed. A predicted image generation unit 508 generates a predicted image based on the image stored in the decoded image storage unit 506, and the motion vector computed by the prediction parameter computation unit 507. That is, based on an image in a frame at a timing, the predicted image generation unit 508 predicts an image in a frame at the next timing, and outputs the predicted image. The predicted image is to be generated also in a decoder.
A selection unit 509 switches data to be selected at an instruction from the prediction parameter computation unit 507. The selection unit 509 selects an output of the predicted image generation unit 508 when an inter-frame coding process is to be performed, and selects ‘0’ when an intra-frame coding process is to be performed.
A prediction error signal generation unit 510 generates a signal indicating an error between an actually input image and an output of the selection unit 509. That is, the prediction error signal generation unit 510 generates a signal indicating an error between a predicted image in the preceding frame and an input image when the inter-frame coding process is performed. On the other band, when the intra-frame coding process is performed, since the output of the selection unit 509 is 0, the prediction error signal generation unit 510 outputs a signal indicating the input image as is.
The output signal is a predicted error signal to be transmitted to a decoder. The predicted error signal is encoded by the orthogonal transform unit 501, the quantization unit 502, and an entropy coding unit 511, and is then transmitted to the decoder 600. The motion vector obtained by the prediction parameter computation unit 507 is also transmitted to the decoder 600.
For each block, the decoder 600 decodes the coded data coded by the encoder 500. An entropy decoding unit 601 corresponds to the entropy coding unit 511. In addition, an inverse quantization unit 602, an inverse orthogonal transform unit 603, a decoded image generation unit 604, a decoded image storage unit 605, a predicted image generation unit 606, and a selection unit 607 are respectively the same as the inverse quantization unit 503, the inverse orthogonal transform unit 504, the decoded image generation unit 505, the decoded image storage unit 506, the predicted image generation unit 508, and the selection unit 509 provided in the encoder 500. Therefore, an output of the decoded image generation unit 604 is an image to be regenerated. The predicted image generation unit 606 generates a predicted image using a motion vector transmitted from the encoder 500.
Thus, in the inter-frame prediction coding method, the prediction data for each block in a target frame is generated using the data in the previously transmitted frame, and the coding process is performed using the prediction data. Here, since the moving picture data has high correlativity in the time direction, an efficient compressing process can be realized using the above described prediction data. It is well-known that the compression rate by the inter-frame coding process is higher than that by the intra-frame coding process. Especially when moving picture data indicating a scene with a smaller change is coded, the effect of a highly efficient process is apparent.
The above described inter-frame prediction coding method is adopted in the standard systems such as ITU-T H.261, ITU-T H.263, MPEG-1, MPEG-2, MPEG-4, etc.
The above described coding method can also be used in an environment in which transmission errors are easily generated as in the radio communications system. Therefore, the decoder 600 includes the function of concealing errors when it detects the errors.
That is, when an error detection unit 608 detects an error, it notifies an error concealment unit 610 of a block in which the error has been detected. On the other hand, an error concealment image generation unit 609 extracts an image in the corresponding block in the previous frame from the decoded image storage unit 605. When the error concealment unit 610 receives the notification from the error detection unit 608, it replaces the image in the block in which the error has been detected with the image extracted by the error concealment image generation unit 609.
Thus, when a transmission error occurs, the decoder 600 conceals the error using the data in the previous frame.
However, when an error occurs in the initial frame (the first frame, or the leading frame) of moving picture, the above described concealing process cannot be performed because the decoder 600 does not have the ‘data in the previous frame’. In this case, the decoder 600 cannot sufficiently conceal the error, and the regenerated image of the first frame contains a block discontinuous to the adjacent blocks as shown in FIG. 3. That is, the quality of the moving picture is considerably deteriorated.
When image data in a frame is decoded in the inter-frame prediction coding process as described above, the image data in the previous frame is used. That is, the image data decoded at a given timing is used when the subsequent image data is decoded. Therefore, once an error has occurred in the inter-frame prediction coding process, the undesired influence of the error on the image quality is propagated to the subsequent frames.
Therefore, when an error occurs in the first frame of moving picture and the error cannot be appropriately concealed in the conventional coding system, the undesired influence of the error on the quality of an image is propagated to the subsequent frames. That is, when an error occurs in the first frame, it takes a long time to obtain an acceptable image even if no errors occur in the subsequent frames.
The above described problem does not occur only in the first frame of moving picture. For example, assuming that an error occurs in a frame immediately after the moving picture has changed from a certain scene to quite a different scene, a similar problem occurs because the decoder does not contain effective ‘data in the previous frame’ to conceal the error.
Thus, if an error occurs in the first frame of moving picture or in a frame immediately after a scene changes into another scene in the conventional decoding system, it takes a long time to obtain an acceptable image.